{extend name="public:_base" /}
{block name="css"}
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/uploadify/uploadify.css">
<style type="text/css">
    .uploadify {
        margin-top: 45px;
    }
</style>
{/block}
{block name="js"}
{include file="public/_validform"}
<!-- 配置文件 -->
<script type="text/javascript" src="__STATIC__/admin/hui/lib/ueditor/1.4.3/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__STATIC__/admin/hui/lib/ueditor/1.4.3/ueditor.all.js"></script>

<!-- 下载文件 -->
<script src="__STATIC__/admin/uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/upfile.js" type="text/javascript"></script>

<script type="text/javascript">
    // var URL = {
    //         uploader:'{:url('Upload/file')}',
    //     swf:'__STATIC__/admin/uploadify/uploadify.swf',
    // }
    // upload_file('file');
    $("[name='cid']").find("[value='{$data.cid ?$data.cid :$Request.param.addcid }']").attr("selected", true);
    var ue = UE.getEditor('editor')
    var URL = {
        uploader: '{:url('Upload/image')}',
        swf:'__STATIC__/admin/uploadify/uploadify.swf',
        ROOT:'__PUBLIC__/uploads/image',
    }
    upload_image('image','','476','267','700');

</script>
{/block}
{block name="main"}

<div class="page-container">

    <form action="{:url(\''.\\think\\Request::instance()->controller().'/save')}" method="post" class="form form-horizontal" id="form">

        <table class="table table-border table-bordered table-bg table-style">
            <thead>
                <tr>
                    <th colspan="2" scope="col">填写信息</th>
                </tr>
            </thead>

            <tbody>
            {include file="public:_navadd"}

                <tr>
                    <th>
                        <span class="c-red">*</span>标题：
                    </th>
                    <td>
                        <input type="text" class="input-text" value="{$data.title ?? ''}" placeholder="标题" datatype="*" name="title" nullmsg="请填写标题">
                    </td>
                </tr>

                <!--<tr>-->
                    <!--<th>-->
                        <!--<span class="c-red">*</span>文件：-->
                    <!--</th>-->
                    <!--<td>-->
                        <!--<input  class="input-text" readonly="readonly" name="file" id="file_post" value="{$data.file ?? ''}" />-->
                        <!--<input id="file" name="file_upload" type="file" multiple="true">-->
                        <!--<input name="old_file" type="hidden" value="{$data.file ?? ''}">-->
                        <!--<div id="queue"></div><a href="__PUBLIC__/uploads/file/{$data.file ?? ''}">{$data.file ?'下载': ''}</a>-->
                    <!--</td>-->
                <!--</tr>-->

                <!--<tr>-->
                    <!--<th>-->
                        <!--<span class="c-red">*</span>大小：-->
                    <!--</th>-->
                    <!--<td>-->
                        <!--<input id="file_size" readonly="readonly" class="input-text" value="{$data.size ?? ''}" placeholder="" datatype="*" name="size">-->
                    <!--</td>-->
                <!--</tr>-->

                <tr>
                    <th>
                        <span class="c-red">*</span>发布人员：
                    </th>
                    <td>
                        <input type="text" class="input-text" value="{$data.issue ?? $Admin.name}" placeholder="发布人员" datatype="*" name="issue" nullmsg="请填写发布人员">
                    </td>
                </tr>
                <tr>
                    <th>
                        图片300*300：
                    </th>
                    <td>
                        <div id="image_s"><img src="__PUBLIC__/uploads/{$data.image ?'image/'.$data.image: 'sm_300.jpg'}" width="200px" height="200px"/></div>
                        <input id="image_post" name="image" type="hidden" value="{$data.image ?? ''}"/>
                        <input name="old_image" type="hidden" value="{$data.image ?? ''}"/>
                        <input id="image" name="image_upload" type="file" multiple="true">
                    </td>
                </tr>
                <tr>
                    <th>
                        简单描述：
                    </th>
                    <td class="textarea-valid">
                        <textarea name="miaoshu" cols="" rows="" class="input-text textarea" placeholder="说点什么...最少输入10个字符"  nullmsg="限制10-100个字符!">{$data.miaoshu ?? ''}</textarea>
                    </td>
                </tr>

                <tr>
                    <th>
                        <span class="c-red">*</span>详细说明：
                    </th>
                    <td>
                        <script id="editor" type="text/plain" name="value" style="width:100%;height:400px;">{$data.value|default=''|html_entity_decode ?? ''}</script>
                    </td>
                </tr>
            </tbody>

            <tfoot>
                <tr>
                    <th></th>
                    <td>
                        <input type="hidden"  value="{$data.id ?? ''}" name="id">
                        {:token()}
                        <input type="hidden" value="{$data.cid ?? $addcid}" name="cidold" />
                        <input class="btn radius btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                        <input class="btn radius btn-default radius" type="reset" value="&nbsp;&nbsp;重置&nbsp;&nbsp;">
                        <!-- <button onClick="layer_close();" class="btn radius btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button> -->
                    </td>
                </tr>
            </tfoot>
        </table>

    </form>

</div>
{/block}
